<admintpl file="header" />
</head>
<body>
    <div class="wrap js-check-wrap">
        <ul class="nav nav-tabs">
            <li class="active"><a href="{:U('Machine/index')}">设备列表</a></li>
        </ul>
        <form class="well form-search js-ajax-form" method="post" action="{:U('Machine/index')}">
        	<button class="btn btn-primary js-ajax-submit" type="submit" data-action="{:U('Machine/update')}">刷新</button>
            只看在线<input type="checkbox" name="online" value="1" style="margin:0 2px 0;"<if condition="I('param.online')"> checked </if>>
            设备类型：
            <select name="snstype" style="width: 110px;">
                <foreach name="snstype" item="vo">
                    <option <if condition="(I('param.snstype') eq $vo['id'])" >selected</if> value="{$vo.id}">{$vo.name}</option>
                </foreach>
            </select>

            查询类型：
            <select name="search" style="width: 95px;">
                <foreach name="search" item="vo">
                    <option <if condition="(I('param.search') eq $vo['id'])" >selected</if> value="{$vo.id}">{$vo.name}</option>
                </foreach>
            </select>
            查询内容：
            <input type="text" name="keyword" style="width: 140px;" value="{:I('param.keyword')}" placeholder="请输入查询内容...">
            接入时间：
            <input type="text" name="start_time" class="js-datetime" value="{:I('param.start_time')}" style="width: 120px;" autocomplete="off"> ~
            <input type="text" name="end_time" class="js-datetime"  value="{:I('param.end_time')}" style="width: 120px;" autocomplete="off">
            <input type="submit" class="btn btn-primary" value="搜索" />
            <if condition="$count" >共查询到 {$count} 条数据</if>
        </form>
            <div class="pagination">{$page}</div>
            <table class="table table-hover table-bordered">
                <thead>
                    <tr>
                        <th>店铺名称/店铺地址</th>
                        <th>IP地址/接入时间</th>
                        <th>机器名/设备状态</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <foreach name="machine" item="vo">
                    <tr>
                        <td>
                        	<foreach name="stores" item="st">
								<if condition="$st['store_id'] eq $vo['store_id']" >
									<a href="{:U('Asset/Store/edit', array('id'=>$st['id']))}">{$st.title}({$st.title_branch})</a><br>{$st.address}
								</if>
                           </foreach>
                        </td>
						<td>{$vo.tmlipaddress}<br>{$vo.tmltime}</td>
						<td>{$vo.name}<br><if condition="$vo['online']" >在线 <else />离线</if></td>
						<td>
							<a href="{:U('Machine/edit', array('id'=>$vo['id']))}">{:L('EDIT')}</a><br>
							<a href="{:U('Machine/shutdown',array('tmlid'=>$vo['tmlid']))}" class="js-ajax-dialog-btn" data-msg="您确定要关机吗？">关机 </a> |
							<a href="{:U('Machine/startup',array('tmlid'=>$vo['tmlid']))}" class="js-ajax-dialog-btn" data-msg="您确定要开机吗？">开机 </a>
						</td>
                    </tr>
                </foreach>
                <thead>
                    <tr>
                        <th>店铺名称/店铺地址</th>
                        <th>IP地址/接入时间</th>
                        <th>机器名/设备状态</th>
                        <th>操作</th>
                    </tr>
                </thead>
            </table>
            <div class="pagination">{$page}</div>
    </div>
    <script src="__PUBLIC__/js/common.js"></script>
</body>
</html>